package com.xinghou.platform.file.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BaseController {

	public static final Integer RESULT_SUCC = 0;
	public static final Integer RESULT_FAIL = 1;

	@ExceptionHandler(Exception.class)
	@ResponseBody
	public String handleException(Exception e) {
		return "{ \"ret\" : "+ RESULT_FAIL +", \"errMsg\" : \"" + e.getMessage() + "\"}";
	}

}
